/*
 * j4Win
 *  http://code.google.com/p/j4win/
 *
 * Copyright (C) 2006-2007 Felix Geyer, Moritz Laschinger
 *
 * This file is part of j4Win.
 *
 * j4Win is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2 as published by the Free Software Foundation.
 *
 * j4Win is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package j4win;

public class StartConsole {
	private static GUIConsole gui = new GUIConsole();
	
	public static void main(String[] args) {
		for (int i=0; i<20; ++i) {
			Game game = new GameServer(
				gui,
				Game.PlayerType.KI, Game.PlayerType.KI,
				new KI[] {new KIMinMax(6), new KISimple()}
			);
			game.start();
		}
		
		Runtime.getRuntime().addShutdownHook(shutdown);
	}
	
	private static Thread shutdown = new Thread() {
		@Override
		public void run() {
			int[] won = gui.getWon();
			int tie = gui.getTie();
			System.out.println("---------------------------------------");
			System.out.println("Player 1 Won: "+won[0]);
			System.out.println("Player 2 Won: "+won[1]);
			System.out.println("Tie         : "+tie);
		}
	};
}
